package com.app.base;

import com.app.utils.web.Param;

/**
 * Description  公共属性枚举类
 * Created by 王伟
 * Date create on 12:18 2019/12/19.
 */
public interface EnumType {
    enum ORDER_STATUS {
        待支付(0),支付(1),已发货(2),确认收货(3),完成(4),申请退货(7),同意退货(8),已退款(9),失效(10),待退款(11),退款中(12);

        private int status;

        ORDER_STATUS(int status){
            this.status = status;
        }

        public int getStatus() {
            return status;
        }

        public static String getName(int status){
            return name(status);
        }
        public static String getColor(int status){
            return color(status);
        }
        public static String name(int status) {
            for (ORDER_STATUS object : ORDER_STATUS.values()) {
                if (object.getStatus()==status) {
                    return object.name();
                }
            }
            return "未知";
        }
        private static String color(int status){
            switch (status){
                case 0:
                case 3:
                    return "#9787ff";
                case 1:
                case 2:
                case 4:
                    return "#3b9744";
                case 7:return "#B4EEB4";
                case 8:
                case 9:
                    return "b2b2b2";
                default:return "#b2b2b2";
            }
        }
    }

    enum ROLE {
        普通用户(0),普卡(1),金卡(2),白金卡(3),超级黑卡(4),商户(10);

        private int role;

        ROLE(int role){
            this.role = role;
        }

        public int getRole() {
            return role;
        }
    }

    enum PAY_TYPE{
        订单支付(1),账户充值(2),代理升级(3),活动预约(4),T3活动预约(5);
        private int type;

        PAY_TYPE(int type){
            this.type = type;
        }

        public int getType() {
            return type;
        }

        public String url(){
            switch (this.type){
                case 1:return Param.sourceUrl + "order/payOver";
                case 2:return Param.sourceUrl + "wallet/recharge";
                case 3:return Param.sourceUrl + "user/up/level";
                case 4:return Param.sourceUrl + "goods/goods/applyBack";
                case 5:return Param.sourceUrl + "t3/goods/goods/act/applyBack";
                default:return "";
            }
        }
    }
}
